<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="业务单" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/css/BillEdit.css" />
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function doSave(contFlag){
		document.getElementById("buttonDiv").style.display="none";
		document.getElementById("waitDiv").style.display="";
		document.getElementById("continue_flag").value=contFlag;
		
		var clientId=document.getElementById("businessBill.clientId").value;
		var cost=document.getElementById("businessBill.cost").value;
		var url="/business/GetCreditAlert.ihtm?bb_id=${command.businessBill.id}&client_id="+clientId+"&cost="+cost;
		var xmlHttp=createXMLHttpRequest();
		xmlHttp.open("GET", url, false);
		xmlHttp.onreadystatechange = function(){
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200) {
					var ret=xmlHttp.responseText;
	      			if(ret!="0"){
						ShowAlert('提示框','客户欠款已超过信用额度！',200,100,'showCreditAlertCallBack()');
	      			}else{
	      				frm.submit();
	      			}
				}
			}
		};
		xmlHttp.send(null);
	}
	function showCreditAlertCallBack(){
		frm.submit();
	}
	function doCancel(){
		if(window.opener){
			window.close();
		}else{
			parent.ClosePop();
		}
	}
	function doCodeCopy(){
		if(checkNavigator()[0]=="msie"){
			var code=document.getElementById("businessBill.billCode").value;
			window.clipboardData.setData("Text",code);
			ShowAlert('提示框','业务单号已复制到剪帖板！',200,100);
		}else{
			ShowAlert('提示框','对不起，当前浏览器不支持剪帖板功能！',200,100);
		}
	}
	function elementOnChnage(){
		checkItemChange(this.getAttribute("index"),this.id);
	}
	function changeIc(index){
		if(document.getElementById("ic_"+index).checked){
			document.getElementById("is_coop_"+index).value="Y";
		}else{
			document.getElementById("is_coop_"+index).value="N";
		}
		checkItemChange(index);
	}
	function changeIs(index){
		if(document.getElementById("is_"+index).checked){
			document.getElementById("is_setu_"+index).value="Y";
		}else{
			document.getElementById("is_setu_"+index).value="N";
		}
		checkItemChange(index);
	}
	function mtAddOnClick(){
		selectMakeType(this.getAttribute("index"));
	}
	function mtDelOnClick(){
		var index=this.getAttribute("index");
		doClear("make_type_id_"+index,"make_type_name_"+index,index,"wc_id_"+index,"wc_name_"+index);
	}
	function inputOnMouseOver(){
		this.title=this.value;
	}
	function proAddOnClick(){
		selectProduct(this.getAttribute("index"));
	}
	function wcAddOnClick(){
		selectWc(this.getAttribute("index"));
	}
	function wcDelOnClick(){
		var index=this.getAttribute("index");
		doClear("wc_id_"+index,"wc_name_"+index,index);
	}
	function selectWc(index){
		var url="/base/WorkCenterListForSelect.ihtm";
		ShowIframe("选择工作中心",url,600,400,"selectWcCallBack("+index+")");
	}
	function selectWcCallBack(index){
		if(popRetVal!=null){
			document.getElementById("wc_id_"+index).value=popRetVal[0];
			document.getElementById("wc_name_"+index).value=popRetVal[1];
			checkItemChange(index);
		}
	}
	function requireButtonOnClick(){
		selectMakeRequire(this.getAttribute("index"));
	}
	function unitButtonOnClick(){
		selectUnit(this.getAttribute("index"));
	}
	function mrTaOnFocus(obj){
		obj.style.height="150px";
	}
	function mrTaOnBlur(obj){
		obj.style.height="50px";
	}
	function doLengTypeChange(index){
		if(document.getElementsByName("lt_"+index)[0].checked){
			document.getElementById("leng_type_"+index).value="M";
		}else{
			if(document.getElementById("price_type_"+index).value=="AREA"){
				document.getElementById("leng_type_"+index).value="MM";
			}else{
				document.getElementById("leng_type_"+index).value="CM";
			}
		}
		checkItemChange(index,"length_"+index);
	}
	function doProNameChange(index){
		document.getElementById("pro_id_"+index).value="0";
		document.getElementById("proFlagSpan_"+index).style.display="none";
		checkItemChange(index);
	}
	function selectProduct(index){
		var url="/base/ProductMainForSelect.ihtm";
		ShowIframe("选择材料",url,900,500,"selectProductCallBack("+index+")",1024,600);
	}
	function selectProductCallBack(index){
		if(popRetVal!=null){
			document.getElementById("pro_id_"+index).value=popRetVal[0];
			document.getElementById("pro_name_"+index).value=popRetVal[2];
			if(document.getElementById("price_type_"+index).value=="AMOUNT"){
				document.getElementById("unit_"+index).value=popRetVal[3];
			}
			document.getElementById("proFlagSpan_"+index).style.display="";
			checkItemChange(index);
		}
	}
	function selectMakeRequire(index){
		var url="/base/MakeRequireListForSelect.ihtm";
		ShowIframe("选择制作要求",url,900,500,"selectMakeRequireCallBack("+index+")",1024,600);
	}
	function selectMakeRequireCallBack(index){
		if(popRetVal!=null){
			var theValue=document.getElementById("make_require_"+index).value;
			for(i=0;i<popRetVal.length;i++){
				if(theValue!=null && theValue!=""){
					theValue=theValue+"\n";
				}
				theValue=theValue+popRetVal[i][0];
			}
			document.getElementById("make_require_"+index).value=theValue;
			checkItemChange(index);
		}
	}
	function selectUnit(index){
		var url="/base/UnitListForSelect.ihtm";
		ShowIframe("选择单位",url,300,400,"selectUnitCallBack("+index+")");
	}
	function selectUnitCallBack(index){
		if(popRetVal!=null){
			document.getElementById("unit_"+index).value=popRetVal[1];
			checkItemChange(index);
		}
	}
	function selectMakeType(index){
		var url="/base/MakeTypeListForSelect.ihtm";
		ShowIframe("选择项目类型",url,310,500,"selectMakeTypeCallBack("+index+")");
	}
	function selectMakeTypeCallBack(index){
		if(popRetVal!=null){
			document.getElementById("make_type_id_"+index).value=popRetVal[0];
			document.getElementById("make_type_name_"+index).value=popRetVal[1];
			document.getElementById("wc_id_"+index).value=popRetVal[2];
			document.getElementById("wc_name_"+index).value=popRetVal[3];
			if(document.getElementById("unit_"+index)!=null){
				document.getElementById("unit_"+index).value=popRetVal[4];
			}
			var mtType = popRetVal[5];
			if(mtType=='2'){
			   document.getElementById("ic_"+index).checked=true;
			   document.getElementById("is_coop_"+index).value="Y";
			}else{
			   document.getElementById("ic_"+index).checked=false;
			   document.getElementById("is_coop_"+index).value="N";
			}
			checkItemChange(index);
		}
	}
	function doItemDelete(index){
		ShowConfirm('确认框','确定删除吗？',340,80,"doItemDeleteCallBack("+index+")");
	}
	function doItemDeleteCallBack(index){
		if(popRetVal!=null){
			document.getElementById("itemTr"+index).style.display="none";
			document.getElementById("status_"+index).value="DELETE";
			doCount();
			
			resizePopwin();
		}
	}
	
	function checkItemChange(index,id){
		if(document.getElementById("id_"+index).value=="" || document.getElementById("id_"+index).value=="0"){
			document.getElementById("status_"+index).value="NEW";
		}else{
			document.getElementById("status_"+index).value="EDIT";
		}
		
		var priceType=document.getElementById("price_type_"+index).value;
		var itemAmount=document.getElementById("amount_"+index).value;
		var itemUnitPrice=document.getElementById("unit_price_"+index).value;
		var itemCost=document.getElementById("cost_"+index).value;
		if(priceType=="AREA"){
			var itemLength=document.getElementById("length_"+index).value;
			var itemWidth=document.getElementById("width_"+index).value;
			var itemSquareNum=document.getElementById("square_num_"+index).value;
			//平方数
			if(!isNaN(itemLength) && !isNaN(itemWidth) && !isNaN(itemAmount)){
				itemSquareNum=accMul(accMul(itemLength,itemWidth),itemAmount);
				if(document.getElementById("leng_type_"+index).value=="MM"){
					itemSquareNum=itemSquareNum/1000000;
				}
				itemSquareNum=parseScale(itemSquareNum,3);
				document.getElementById("square_num_"+index).value=itemSquareNum;
			}
			//规格
			if(id=="length_"+index || id=="width_"+index){
				if(!isNaN(itemLength) && !isNaN(itemWidth)){
					var lt=document.getElementById("leng_type_"+index).value.toLowerCase();;
					var speStr="";
					if(itemLength-0!=0){
						speStr=itemLength+lt;
					}
					if(itemWidth-0!=0){
						if(speStr!=""){
							speStr=speStr+" x ";
						}
						speStr=speStr+itemWidth+lt;
					}
					document.getElementById("specification_"+index).value=speStr+"高";
				}
			}
			//金额
			if(!isNaN(itemSquareNum) && !isNaN(itemUnitPrice)){
				itemCost=accMul(itemSquareNum,itemUnitPrice);
				document.getElementById("cost_"+index).value=parseScale(itemCost,2);
			}
		}else if(priceType=="AMOUNT"){
			//金额
			if(!isNaN(itemAmount) && !isNaN(itemUnitPrice)){
				itemCost=accMul(itemAmount,itemUnitPrice);
				document.getElementById("cost_"+index).value=parseScale(itemCost,2);
			}
		}else if(priceType=="LENGTH"){
			var itemLength=document.getElementById("length_"+index).value;
			var itemWidth=document.getElementById("width_"+index).value;
			var itemSquareNum=document.getElementById("square_num_"+index).value;
			var lengType="${enterpriseInfo.busiLengType}";
			//长度
			if(!isNaN(itemLength) && !isNaN(itemWidth) && !isNaN(itemAmount)){
				if(lengType=="WIDTH"){
					itemSquareNum=accMul(itemLength,itemAmount);
				}else if(lengType=="TALL"){
					itemSquareNum=accMul(itemWidth,itemAmount);
				}else{
					if(Number(itemLength)>Number(itemWidth)){
						itemSquareNum=accMul(itemLength,itemAmount);
					}else{
						itemSquareNum=accMul(itemWidth,itemAmount);
					}
				}
				itemSquareNum=parseScale(itemSquareNum,3);
				document.getElementById("square_num_"+index).value=itemSquareNum;
			}
			//规格
			if(id=="length_"+index || id=="width_"+index){
				if(!isNaN(itemLength) && !isNaN(itemWidth)){
					var lt=document.getElementById("leng_type_"+index).value.toLowerCase();;
					var speStr="";
					if(itemLength-0!=0){
						speStr=itemLength+lt;
					}
					if(itemWidth-0!=0){
						if(speStr!=""){
							speStr=speStr+" x ";
						}
						speStr=speStr+itemWidth+lt;
					}
					document.getElementById("specification_"+index).value=speStr;
				}
			}
			//金额
			if(!isNaN(itemSquareNum) && !isNaN(itemUnitPrice)){
				itemCost=accMul(itemSquareNum,itemUnitPrice);
				document.getElementById("cost_"+index).value=parseScale(itemCost,2);
			}
		}
		doCount();
	}
	
	function doCount(){
		var itemNum=document.getElementById("item_num").value-0;
		var costTotal=0;
		var itemCost;
		var itemAmount;
		
		var priceType;
		var lengItemNum=0,areaItemNum=0,amouItemNum=0;
		var lengMTotal=0,lengCmTotal=0,areaTotal=0,amountTotal=0;
		
		for(var i=0;i<itemNum;i++){
			if(document.getElementById("status_"+i).value!="DELETE"){
				itemCost=document.getElementById("cost_"+i).value;
				if(!isNaN(itemCost)){
					costTotal=addMul(costTotal,itemCost);
				}
				
				priceType=document.getElementById("price_type_"+i).value;
				if(priceType=="AMOUNT"){
					itemAmount=document.getElementById("amount_"+i).value;
					if(!isNaN(itemAmount)){
						amountTotal=addMul(amountTotal,itemAmount);
					}
					amouItemNum=amouItemNum+1;
				}else if(priceType=="AREA"){
					var itemArea=document.getElementById("square_num_"+i).value;
					if(!isNaN(itemArea)){
						areaTotal=addMul(areaTotal,itemArea);
					}
					areaItemNum=areaItemNum+1;
				}else if(priceType=="LENGTH"){
					var itemLength=document.getElementById("square_num_"+i).value;
					if(!isNaN(itemLength)){
						if(document.getElementById("leng_type_"+i).value=="M"){
							lengMTotal=addMul(lengMTotal,itemLength);
						}else{
							lengCmTotal=addMul(lengCmTotal,itemLength);
						}
					}
					lengItemNum=lengItemNum+1;
				}
			}
		}
		var favCost=document.getElementById("favCostStr").value;
		if(!isNaN(favCost)){
			costTotal=abateMul(costTotal,favCost);
		}
		
		document.getElementById("businessBill.cost").value=costTotal;
		
		if(document.getElementById("areaTotalSpan")!=null){
			document.getElementById("areaTotalSpan").innerHTML="记录："+areaItemNum+"条&nbsp;面积："+areaTotal+"平方米&nbsp;";
		}
		if(document.getElementById("amountTotalSpan")!=null){
			document.getElementById("amountTotalSpan").innerHTML="记录："+amouItemNum+"条&nbsp;数量："+amountTotal+"&nbsp;";
		}
		if(document.getElementById("lengTotalSpan")!=null){
			document.getElementById("lengTotalSpan").innerHTML="记录："+lengItemNum+"条&nbsp;长度："+lengMTotal+"米&nbsp;"+lengCmTotal+"公分&nbsp;";
		}
		
		resizePopwin();
	}
	function selectStaffer(idObjId,nameObjId){
		var url="/base/StafferMainForSelect.ihtm";
		ShowIframe("选择员工",url,800,500,"selectStafferCallBack('"+idObjId+"','"+nameObjId+"')",1024,600);
	}
	function selectStafferCallBack(idObjId,nameObjId){
		if(popRetVal!=null){
			var arr=popRetVal.split(";");
			document.getElementById(idObjId).value=arr[0];
			document.getElementById(nameObjId).value=arr[1];
		}
	}
	function selectStafferRate(type,idObjId,nameObjId){
		var url="/base/StafferMainForSelect.ihtm?type=MULTI";
		ShowIframe("选择员工",url,800,500,"selectStafferRateCallBack('"+type+"','"+idObjId+"','"+nameObjId+"')",1024,600);	
	}
	function selectStafferRateCallBack(type,idObjId,nameObjId){
		if(popRetVal!=null){
			var idStr="";
			var nameStr="";
			for(i=0;i<popRetVal.length;i++){
				if(idStr!=""){
					idStr=idStr+";";
					nameStr=nameStr+";";
				}
				idStr=idStr+popRetVal[i][0];
				nameStr=nameStr+popRetVal[i][2];
			}
			if(idStr!=""){
				var url="/business/SetStafferRate.ihtm?type="+type+"&id_str="+idStr+"&name_str="+encodeURIComponent(nameStr);
				ShowIframe("设置占比",url,335,250,"selectStafferRateCallBackExt('"+idObjId+"','"+nameObjId+"')");
			}
		}
	}
	function selectStafferRateCallBackExt(idObjId,nameObjId){
		if(popRetVal!=null){
			//var idStr=document.getElementById(idObjId).value;
			//var nameStr=document.getElementById(nameObjId).value;
			var idStr="";
			var nameStr="";
			if(idStr==""){
				idStr=";"+popRetVal[0]+";";
				nameStr=popRetVal[1];
			}else{
				idStr=idStr+popRetVal[0]+";";
				nameStr=nameStr+";"+popRetVal[1];
			}
			document.getElementById(idObjId).value=idStr;
			document.getElementById(nameObjId).value=nameStr;
		}
	}
	function clearStafferRate(idObjId,nameObjId){
		document.getElementById(idObjId).value="";
		document.getElementById(nameObjId).value="";
	}
	function selectContact(){
		if(document.getElementById("canSelectContact").value=="Y"){
			var estId=document.getElementById("businessBill.clientId").value;
			var url="/base/ContactListForSelect.ihtm?est_id="+estId;
			ShowIframe("选择联系人",url,500,320,"selectContactCallBack()");
		}else{
			ShowAlert('提示框','订货单位不是您权限范围内的客户，不能选择联系人！',200,100);
		}
	}
	function selectContactCallBack(){
		if(popRetVal!=null){
			document.getElementById("businessBill.linkman").value=popRetVal[0];
			document.getElementById("businessBill.phone").value=popRetVal[1];
		}
	}
	function selectClient(){
		var url="/base/EstablishmentListForSelect.ihtm?type=CLIENT&ts_id=${command.businessBill.tallySetId}&order_type=BUS_TIME";
		ShowIframe("选择客户",url,900,500,"selectClientCallBack()",1024,600);
	}
	function selectClientCallBack(){
		if(popRetVal!=null){
			document.getElementById("businessBill.clientId").value=popRetVal[0];
			document.getElementById("clientName").value=popRetVal[1];
			if(popRetVal[2]!="0"){
				document.getElementById("businessBill.managerId").value=popRetVal[2];
				document.getElementById("businessBill.managerName").value=popRetVal[3];
			}
			document.getElementById("canSelectContact").value=popRetVal[4];
			document.getElementById("businessBill.address").value=popRetVal[6];
			if(popRetVal[4]=="Y"){
				document.getElementById("businessBill.linkman").value=popRetVal[7];
				document.getElementById("businessBill.phone").value=popRetVal[8];
			}else{
				document.getElementById("businessBill.linkman").value="";
				document.getElementById("businessBill.phone").value=popRetVal[5];
			}
			setFocus("businessBill.linkman");
		}
	}
	function changeTimeSelect(obj,targetName){
		document.getElementById(targetName).value=obj.value;
	}
	
	function doClear(idObjId,nameObjId,index,extIdObjId,extNameObjId){
		if(idObjId!=null && idObjId!=''){
			document.getElementById(idObjId).value="0";
		}
		if(nameObjId!=null && nameObjId!=''){
			document.getElementById(nameObjId).value="";
		}
		if(extIdObjId!=null && extIdObjId!=''){
			document.getElementById(extIdObjId).value="0";
		}
		if(extNameObjId!=null && extNameObjId!=''){
			document.getElementById(extNameObjId).value="";
		}
		if(index!=null){//奶奶的，js里面0跟''比较是相等的，所以这里不能用index!=''，否则index为0时有问题
			checkItemChange(index);
		}
	}
	function doInit(){
		setFocus("businessBill.linkman");
		showFormErrorMsg();
	}
	function refreshAccWin(){
		if(popRetVal!=null){
			document.getElementById("accessoryFrm").contentWindow.refreshWin();
		}
	}
	function doDelAcc(id){
		if(popRetVal!=null){
			document.getElementById("accessoryFrm").contentWindow.doDelAct(id);
		}
	}
	function doCopAcc(id){
		if(popRetVal!=null){
			document.getElementById("accessoryFrm").contentWindow.doCopAct(id);
		}
	}
	function showAccImg(fileName){
		var img=new Image();//要new一个变量而不能直接用document.getElementById("accImg")来设置,否则设置一次width后就不会变了
		img.src=fileName;
		if(img.complete){//缓存中读取
			img.onload=null;
			accLoadCallback(img,fileName);
		}else{
			img.onload = function () {
				accLoadCallback(img,fileName);
			}
		}
	}
	
	function accLoadCallback(img,fileName){
		var obj=document.getElementById("accImg");
		obj.width=img.width>800?800:img.width;
		obj.src=fileName;
		document.getElementById("accImgSpan").style.display="";
	}
</script>
</head>
<body onload="doInit();">
<div class="Wrap">
	<form name="frm" method="post">
	<div class="Container">
		<div class="Contnet Paper">
			<c:set var="codeReadOnlyStr" value="" /><!-- 编码框是否可点击 -->
			<c:set var="codeReadOnlyClassStr" value="" /><!-- 编码框颜色 -->
			<c:set var="prodReadOnlyStr" value="" /><!-- 材料框是否可点击 -->
			<c:set var="prodReadOnlyClassStr" value="" /><!-- 材料框颜色 -->
	      	<c:set var="dateEdit" value="Y" /><!-- 是否可以编辑日期 -->
	      	
			<c:set var="pageTopTitle" value="新增业务单" />
			<c:if test="${command.codeRule.generateRule!='MANUAL'}">
				<c:set var="codeReadOnlyStr" value="readonly='readonly'" />
				<c:set var="codeReadOnlyClassStr" value="readonly" />
			</c:if>
			<c:if test="${enterpriseInfo.busiProd=='SELECT'}">
				<c:set var="prodReadOnlyStr" value="readonly='readonly'" />
				<c:set var="prodReadOnlyClassStr" value="readonly" />
			</c:if>
			<c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';NO_BILL_DATE;')!=-1}">
				<c:set var="dateEdit" value="N" />
			</c:if>
			
			<!-- 提示信息 -->
			<%@ include file="../inc/BillPageTop.jsp"%>
			
			<!--业务单 标题-->
			<br>
	        <table class="BillHeading" cellspacing="0" cellpadding="0">
	        	<tr>
		            <td width="301px;" rowspan="2" ><div class="CorpLogo"><img src="${enterpriseInfo.loginImage}" /></div></td>
		            <td width="301px;" rowspan="2" ><h1>${pageTopTitle}</h1></td>
		            <td width="301px;" class="tr vb codeTd">
		                <span class="MustInput">*</span>编号：
		                <spring:bind path="command.businessBill.billCode">
				    	<input type="text" class="tbBillCode TextBox ${codeReadOnlyClassStr}" ${codeReadOnlyStr} maxlength="30" onKeyUp="goNextInput('orderDateStr');" id="${status.expression}" name="${status.expression}" value="${status.value}">
				    	<script language="javascript">
							setFormErrorMsg('<c:out value="${status.errorMessage}" />',1,'businessBill.billCode');
						</script>
			     		</spring:bind>
		            </td>
	        	</tr>
	        	<tr>
	            	<td class="tr" >
		            	<span class="MustInput">*</span>订货日期：
		            	<spring:bind path="command.orderDateStr">
		                    <input type="text" class="tbBillDate TextBox <c:if test="${dateEdit=='N'}">readonly</c:if>" maxlength="15" onKeyUp="goNextInput('businessBill.linkman');" id="${status.expression}" name="${status.expression}" value="${status.value}" <c:if test="${dateEdit=='N'}">readonly="readonly"</c:if> />
		                    <c:if test="${dateEdit=='Y'}"><img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('orderDateStr'),'yyyy-mm-dd',document.getElementById('orderDateStr'));"></c:if>
		                    <select id="orderDateHourSelect" class="ddlDateHour" onChange="changeTimeSelect(this,'orderDateHour');" <c:if test="${dateEdit=='N'}">disabled="disabled" style="background:#f6f6f6;"</c:if>>
		                        <c:forEach var="item" begin="0" step="1" end="23" varStatus="i"><c:if test="${i.index<10}"><c:set var="item" value="0${item}" /></c:if><option value="${item}" <c:if test="${item==command.orderDateHour}">selected</c:if>>${item}</option></c:forEach>
		                    </select>
		                    <select id="orderDateMinuteSelect" class="ddlDateMinute" onChange="changeTimeSelect(this,'orderDateMinute');" <c:if test="${dateEdit=='N'}">disabled="disabled" style="background:#f6f6f6;"</c:if>>
		                        <c:forEach var="item" begin="0" step="1" end="59" varStatus="i"><c:if test="${i.index<10}"><c:set var="item" value="0${item}" /></c:if><option value="${item}" <c:if test="${item==command.orderDateMinute}">selected</c:if>>${item}</option></c:forEach>
		                    </select>
		                    <script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',2,'orderDateStr');
						    </script>
		                </spring:bind>
	            	</td>
	        	</tr>
	        </table>
		
			<!-- 业务单 头信息 -->
	        <div class="TopBottom_Border">
	        	<table class="BillHeadInfo" cellspacing="0" cellpadding="0">
	        		<tr>
	            		<td width="314px;">
	                		<span class="MustInput">*</span>客户：
	                		<spring:bind path="command.clientName">
	                    	<input class="tbHead1 TextBox readonly" readonly="readonly" type="text" id="${status.expression}" name="${status.expression}" value="${status.value}">
					      	<img class="make-a" src="/images/make-a.gif" style="cursor:pointer;" onClick="selectClient();">
	                		</spring:bind>
	                		<spring:bind path="command.businessBill.clientId">
	                    	<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
	                    	<script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',3);
						    </script>
	                		</spring:bind>
	                		<span id="spClientInfo" class="lbClientNote">${command.clientLevel}</span>
	            		</td>
	            		<td width="386px;">
	                		联系人：
	                		<spring:bind path="command.businessBill.linkman">
	                    	<input type="text" class="tbHead2_1_short TextBox" maxlength="15" onKeyUp="goNextInput('businessBill.phone');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
	                    	<img class="make-a" src="/images/make-a.gif" style="cursor:pointer;" onClick="selectContact();" />
	                		<script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',4,'businessBill.linkman');
							</script>
	                		</spring:bind>
	                		电话：
	                		<spring:bind path="command.businessBill.phone">
	                    	<input type="text" class="tbHead2_2 TextBox" maxlength="40" onKeyUp="goNextInput('businessBill.contractCode');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
	                    	<script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',5,'businessBill.phone');
						    </script>
	                		</spring:bind>
	            		</td>
	            		<td width="204px;" class="tr">
	                		合同号：
	                		<spring:bind path="command.businessBill.contractCode">
	                    	<input type="text" class="tbHead3 TextBox" maxlength="50" onKeyUp="goNextInput('businessBill.setupRequire');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
	                    	<script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',6,'businessBill.contractCode');
						    </script>
	                		</spring:bind>
	            		</td>
	        		</tr>
	        	</table>
	        </div>
			<span id="accImgSpan" style="width:100%;float:left;text-align:center;display:none"><img id="accImg"></span>
			<!-- 业务单 明细 -->
	        <input type="hidden" id="item_num" name="item_num" value="${fn:length(command.items)}">
	        <c:if test="${fn:indexOf(enterpriseInfo.bbPriceType,';AREA;')!=-1 || command.hasAreaItem=='Y'}">
	        <table id="BillDetails" class="BillDetails" width="100%" cellspacing="0" cellpadding="0">
	        	<tbody id="areaItemRowTbl">
	        	<tr>
	        		<th width="10%">项目类型</th>
					<th width="16%">内容</th>
					<th width="8%">材质</th>
					<th width="12%">宽x高</th>
					<th width="10%">规格</th>
					<th width="15%">制作要求</th>
					<th width="5%">数量</th>
					<th width="7%">平方数</th>
					<th width="5%">外协</th>
					<th width="7%">自制</th>
					<th width="5%">操作</th>
				</tr>
				<c:forEach var="item" items="${command.items}" varStatus="i">
				<c:if test="${item.businessBillItem.priceType=='AREA'}">
				<tr id="itemTr${i.index}" <c:if test="${item.status=='DELETE'}">style="display:none"</c:if>>
					<td >
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:62px" id="make_type_name_${i.index}" name="make_type_name_${i.index}" value='<commonTag:showSimpleObjectName list="${makeTypeList}" objectId="${item.businessBillItem.makeTypeId}" />' onmouseover="this.title=this.value">
						<br>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectMakeType(${i.index});">
						<img src="/images/icon_del.gif" style="cursor:pointer;" onClick="doClear('make_type_id_${i.index}','make_type_name_${i.index}',${i.index},'wc_id_${i.index}','wc_name_${i.index}');">
						<input type="hidden" id="make_type_id_${i.index}" name="make_type_id_${i.index}" value="${item.businessBillItem.makeTypeId}" >
					</td>
					<td >
						<textarea class="TextBox" name="finished_content_${i.index}" style="width:130px;height:50px" id="finished_content_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.finishedContent}" /></textarea>
					</td>
					<td >
						<input type="text" class="TextBox ${prodReadOnlyClassStr}" ${prodReadOnlyStr} style="width:62px" id="pro_name_${i.index}" name="pro_name_${i.index}" value="${item.businessBillItem.proName}" onChange="doProNameChange(${i.index});" onmouseover="this.title=this.value">
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectProduct(${i.index},'');" title="直接录入多个材质组合，如果是单一材质，可以直接从材料档案中选择"><span class="MustInput" id="proFlagSpan_${i.index}" <c:if test="${item.businessBillItem.proId==0}">style="display:none"</c:if>>*</span>
						<input type="hidden" id="pro_id_${i.index}" name="pro_id_${i.index}" value="${item.businessBillItem.proId}" >
					</td>
					<td >
						<input type="text" class="TextBox" style="width:28px" maxlength="10" id="length_${i.index}" name="length_${i.index}" value="${item.lengthStr}" onChange="checkItemChange(${i.index},this.id);">
						x
						<input type="text" class="TextBox" style="width:28px" maxlength="10" id="width_${i.index}" name="width_${i.index}" value="${item.widthStr}" onChange="checkItemChange(${i.index},this.id);">
						<br>
						<input type="radio" name="lt_${i.index}" onClick="doLengTypeChange(${i.index});" <c:if test="${item.businessBillItem.lengType=='M'}">checked="true"</c:if> ${editDisabledStr}>m<input type="radio" name="lt_${i.index}" onClick="doLengTypeChange(${i.index});" <c:if test="${item.businessBillItem.lengType=='MM'}">checked="true"</c:if> ${editDisabledStr}>mm
						<input type="hidden" name="leng_type_${i.index}" id="leng_type_${i.index}" value="${item.businessBillItem.lengType}">
					</td>
					<td >
						<textarea class="TextBox" name="specification_${i.index}" style="width:80px;height:50px" id="specification_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.specification}" /></textarea>
					</td>
					<td >
						<textarea class="TextBox" name="make_require_${i.index}" style="width:100px;height:50px" onfocus="mrTaOnFocus(this)" onblur="mrTaOnBlur(this)" id="make_require_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.makeRequire}" /></textarea>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectMakeRequire(${i.index},'');">
					</td>
					<td >
						<input type="text" class="TextBox" style="width:34px" maxlength="10" id="amount_${i.index}" name="amount_${i.index}" value="${item.amountStr}" onChange="checkItemChange(${i.index},this.id);">
					</td>
					<td >
						<input class="TextBox readonly" readonly="readonly" type="text" style="width:42px" maxlength="10" id="square_num_${i.index}" name="square_num_${i.index}" value='<commonTag:parseBigDecimal source="${item.businessBillItem.squareNum}" />'>
					</td>
					<td >
						<input type="checkbox" class="TextBox" id="ic_${i.index}" name="ic_${i.index}" value="1" <c:if test="${item.businessBillItem.isCoop=='Y'}">checked</c:if> onChange="changeIc(${i.index});">
					</td>
					<td >
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:44px" id="wc_name_${i.index}" name="wc_name_${i.index}" value='<commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.businessBillItem.wcId}" />' title='<commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.businessBillItem.wcId}" />'>
						<br>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectWc(${i.index});" title="项目选择了工作中心,就会出现在制作管理中">
						<img src="/images/icon_del.gif" style="cursor:pointer;" onClick="doClear('wc_id_${i.index}','wc_name_${i.index}',${i.index});">
						安装<input type="checkbox" class="TextBox" ${editDisabledStr} id="is_${i.index}" name="is_${i.index}" value="1" <c:if test="${item.businessBillItem.isSetu=='Y'}">checked</c:if> onChange="changeIs(${i.index});">
					</td>
					<td >
						<a href="javascript:doItemDelete(${i.index});">删除</a>
						<input type="hidden" id="status_${i.index}" name="status_${i.index}" value="${item.status}">
						<input type="hidden" id="price_type_${i.index}" name="price_type_${i.index}" value="${item.businessBillItem.priceType}">
						<input type="hidden" id="id_${i.index}" name="id_${i.index}" value="${item.oldId}">
						<input type="hidden" id="wc_id_${i.index}" name="wc_id_${i.index}" value="${item.businessBillItem.wcId}">
						<input type="hidden" id="unit_price_${i.index}" name="unit_price_${i.index}" value="${item.unitPriceStr}">
						<input type="hidden" id="cost_${i.index}" name="cost_${i.index}" value="${item.businessBillItem.cost}">
						<input type="hidden" id="is_coop_${i.index}" name="is_coop_${i.index}" value="${item.businessBillItem.isCoop}">
						<input type="hidden" id="is_setu_${i.index}" name="is_setu_${i.index}" value="${item.businessBillItem.isSetu}">
					</td>
				</tr>
				</c:if>
				</c:forEach>
				</tbody>
			</table>
			<div class="table-bot">
				 <span id="areaTotalSpan" style="float:right;PADDING-RIGHT:10px;color:#aaa">
				 	记录：${command.areaItemNum}条&nbsp;
					面积：<commonTag:parseBigDecimal source="${command.businessBill.square}" />平方米&nbsp;
				 </span>
			</div>
			<br>
			</c:if>
			
			<c:if test="${fn:indexOf(enterpriseInfo.bbPriceType,';LENGTH;')!=-1 || command.hasLengthItem=='Y'}">
	        <table id="BillDetails" class="BillDetails" width="100%" cellspacing="0" cellpadding="0">
	        	<tbody id="lengthItemRowTbl">
				<tr>
					<th width="10%">项目类型</th>
					<th width="16%">内容</th>
					<th width="8%">材质</th>
					<th width="12%">宽x高</th>
					<th width="10%">规格</th>
					<th width="15%">制作要求</th>
					<th width="5%">数量</th>
					<th width="7%">总长度</th>
					<th width="5%">外协</th>
					<th width="7%">自制</th>
					<th width="5%">操作</th>
				</tr>
				<c:forEach var="item" items="${command.items}" varStatus="i">
				<c:if test="${item.businessBillItem.priceType=='LENGTH'}">
				<tr id="itemTr${i.index}" <c:if test="${item.status=='DELETE'}">style="display:none"</c:if>>
					<td>
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:62px" id="make_type_name_${i.index}" name="make_type_name_${i.index}" value='<commonTag:showSimpleObjectName list="${makeTypeList}" objectId="${item.businessBillItem.makeTypeId}" />' onmouseover="this.title=this.value">
						<br>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectMakeType(${i.index});">
						<img src="/images/icon_del.gif" style="cursor:pointer;" onClick="doClear('make_type_id_${i.index}','make_type_name_${i.index}',${i.index},'wc_id_${i.index}','wc_name_${i.index}');">
						<input type="hidden" id="make_type_id_${i.index}" name="make_type_id_${i.index}" value="${item.businessBillItem.makeTypeId}" >
					</td>
					<td >
						<textarea class="TextBox" name="finished_content_${i.index}" style="width:130px;height:50px" id="finished_content_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.finishedContent}" /></textarea>
					</td>
					<td >
						<input type="text" class="TextBox ${prodReadOnlyClassStr}" ${prodReadOnlyStr} style="width:62px" id="pro_name_${i.index}" name="pro_name_${i.index}" value="${item.businessBillItem.proName}" onChange="checkItemChange(${i.index},this.id);" onmouseover="this.title=this.value">
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectProduct(${i.index},'');" title="直接录入多个材质组合，如果是单一材质，可以直接从材料档案中选择"><span class="MustInput" id="proFlagSpan_${i.index}" <c:if test="${item.businessBillItem.proId==0}">style="display:none"</c:if>>*</span>
						<input type="hidden" id="pro_id_${i.index}" name="pro_id_${i.index}" value="${item.businessBillItem.proId}" >
					</td>
					<td >
						<input type="text" class="TextBox" style="width:28px" maxlength="10" id="length_${i.index}" name="length_${i.index}" value="${item.lengthStr}" onChange="checkItemChange(${i.index},this.id);">
						x
						<input type="text" class="TextBox" style="width:28px" maxlength="10" id="width_${i.index}" name="width_${i.index}" value="${item.widthStr}" onChange="checkItemChange(${i.index},this.id);">
					</td>
					<td >
						<textarea class="TextBox" name="specification_${i.index}" style="width:80px;height:50px" id="specification_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.specification}" /></textarea>
					</td>
					<td >
						<textarea class="TextBox" name="make_require_${i.index}" style="width:100px;height:50px" onfocus="mrTaOnFocus(this)" onblur="mrTaOnBlur(this)" id="make_require_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.makeRequire}" /></textarea>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectMakeRequire(${i.index});">
					</td>
					<td >
						<input type="text" class="TextBox" style="width:34px" maxlength="10" id="amount_${i.index}" name="amount_${i.index}" value="${item.amountStr}" onChange="checkItemChange(${i.index},this.id);">
					</td>
					<td >
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:42px" maxlength="10" id="square_num_${i.index}" name="square_num_${i.index}" value='<commonTag:parseBigDecimal source="${item.businessBillItem.squareNum}" />'>
						<input type="radio" name="lt_${i.index}" onClick="doLengTypeChange(${i.index});" <c:if test="${item.businessBillItem.lengType=='M'}">checked="true"</c:if>>m<input type="radio" name="lt_${i.index}" onClick="doLengTypeChange(${i.index});" <c:if test="${item.businessBillItem.lengType=='CM'}">checked="true"</c:if>>cm
						<input type="hidden" name="leng_type_${i.index}" id="leng_type_${i.index}" value="${item.businessBillItem.lengType}">
					</td>
					<td >
						<input type="checkbox" class="TextBox" id="ic_${i.index}" name="ic_${i.index}" value="1" <c:if test="${item.businessBillItem.isCoop=='Y'}">checked</c:if> onChange="changeIc(${i.index});">
					</td>
					<td >
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:44px" id="wc_name_${i.index}" name="wc_name_${i.index}" value='<commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.businessBillItem.wcId}" />' title='<commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.businessBillItem.wcId}" />'>
						<br>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectWc(${i.index});" title="项目选择了工作中心,就会出现在制作管理中">
						<img src="/images/icon_del.gif" style="cursor:pointer;" onClick="doClear('wc_id_${i.index}','wc_name_${i.index}',${i.index});">
						安装<input type="checkbox" class="TextBox" ${editDisabledStr} id="is_${i.index}" name="is_${i.index}" value="1" <c:if test="${item.businessBillItem.isSetu=='Y'}">checked</c:if> onChange="changeIs(${i.index});">
					</td>
					<td >
						<a href="javascript:doItemDelete(${i.index});">删除</a>
						<input type="hidden" id="status_${i.index}" name="status_${i.index}" value="${item.status}">
						<input type="hidden" id="price_type_${i.index}" name="price_type_${i.index}" value="${item.businessBillItem.priceType}">
						<input type="hidden" id="id_${i.index}" name="id_${i.index}" value="${item.oldId}">
						<input type="hidden" id="wc_id_${i.index}" name="wc_id_${i.index}" value="${item.businessBillItem.wcId}">
						<input type="hidden" id="unit_price_${i.index}" name="unit_price_${i.index}" value="${item.unitPriceStr}">
						<input type="hidden" id="cost_${i.index}" name="cost_${i.index}" value="${item.businessBillItem.cost}">
						<input type="hidden" id="is_coop_${i.index}" name="is_coop_${i.index}" value="${item.businessBillItem.isCoop}">
						<input type="hidden" id="is_setu_${i.index}" name="is_setu_${i.index}" value="${item.businessBillItem.isSetu}">
					</td>
				</tr>
				</c:if>
				</c:forEach>
				</tbody>
			 </table>
			 <div class="table-bot">
				 <span id="lengTotalSpan" style="float:right;PADDING-RIGHT:10px;color:#aaa">
				 	记录：${command.lengItemNum}条&nbsp;
					长度：<commonTag:parseBigDecimal source="${command.businessBill.lengM}" />米&nbsp;<commonTag:parseBigDecimal source="${command.businessBill.lengCm}" />公分&nbsp;
				 </span>
			</div>
			<br>
			</c:if>

			<c:if test="${fn:indexOf(enterpriseInfo.bbPriceType,';AMOUNT;')!=-1 || command.hasAmountItem=='Y'}">
	        <table id="BillDetails" class="BillDetails" width="100%" cellspacing="0" cellpadding="0">
	        	<tbody id="amountItemRowTbl">
				<tr>
					<th width="10%">项目类型</th>
					<th width="16%">内容</th>
					<th width="8%">材质</th>
					<th width="12%">规格</th>
					<th width="22%">制作要求</th>
					<th width="8%">单位</th>
					<th width="7%">数量</th>
					<th width="5%">外协</th>
					<th width="7%">自制</th>
					<th width="5%">操作</th>
				</tr>
				<c:forEach var="item" items="${command.items}" varStatus="i">
				<c:if test="${item.businessBillItem.priceType=='AMOUNT'}">
				<tr id="itemTr${i.index}" <c:if test="${item.status=='DELETE'}">style="display:none"</c:if>>
					<td>
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:62px" id="make_type_name_${i.index}" name="make_type_name_${i.index}" value='<commonTag:showSimpleObjectName list="${makeTypeList}" objectId="${item.businessBillItem.makeTypeId}" />' onmouseover="this.title=this.value">
						<br>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectMakeType(${i.index});">
						<img src="/images/icon_del.gif" style="cursor:pointer;" onClick="doClear('make_type_id_${i.index}','make_type_name_${i.index}',${i.index},'wc_id_${i.index}','wc_name_${i.index}');">
						<input type="hidden" id="make_type_id_${i.index}" name="make_type_id_${i.index}" value="${item.businessBillItem.makeTypeId}" >
					</td>
					<td >
						<textarea class="TextBox" name="finished_content_${i.index}" style="width:130px;height:50px" id="finished_content_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.finishedContent}" /></textarea>
					</td>
					<td >
						<input type="text" class="TextBox ${prodReadOnlyClassStr}" ${prodReadOnlyStr} style="width:62px" id="pro_name_${i.index}" name="pro_name_${i.index}" value="${item.businessBillItem.proName}" onChange="checkItemChange(${i.index},this.id);" onmouseover="this.title=this.value">
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectProduct(${i.index},'');" title="直接录入多个材质组合，如果是单一材质，可以直接从材料档案中选择"><span class="MustInput" id="proFlagSpan_${i.index}" <c:if test="${item.businessBillItem.proId==0}">style="display:none"</c:if>>*</span>
						<input type="hidden" id="pro_id_${i.index}" name="pro_id_${i.index}" value="${item.businessBillItem.proId}" >
					</td>
					<td >
						<textarea class="TextBox" name="specification_${i.index}" style="width:80px;height:50px" id="specification_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.specification}" /></textarea>
					</td>
					<td >
						<textarea class="TextBox" name="make_require_${i.index}" style="width:160px;height:50px" onfocus="mrTaOnFocus(this)" onblur="mrTaOnBlur(this)" id="make_require_${i.index}" onChange="checkItemChange(${i.index},this.id);"><c:out value="${item.businessBillItem.makeRequire}" /></textarea>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectMakeRequire(${i.index});">
					</td>
					<td >
						<input type="text" class="TextBox" style="width:38px" maxlength="10" id="unit_${i.index}" name="unit_${i.index}" value="${item.businessBillItem.unit}" onChange="checkItemChange(${i.index},this.id);">
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectUnit(${i.index});">
					</td>
					<td >
						<input type="text" class="TextBox" style="width:42px" maxlength="10" id="amount_${i.index}" name="amount_${i.index}" value="${item.amountStr}" onChange="checkItemChange(${i.index},this.id);">
					</td>
					<td >
						<input type="checkbox" class="TextBox" id="ic_${i.index}" name="ic_${i.index}" value="1" <c:if test="${item.businessBillItem.isCoop=='Y'}">checked</c:if> onChange="changeIc(${i.index});">
					</td>
					<td >
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:44px" id="wc_name_${i.index}" name="wc_name_${i.index}" title='<commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.businessBillItem.wcId}" />' value='<commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.businessBillItem.wcId}" />'>
						<br>
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectWc(${i.index});" title="项目选择了工作中心,就会出现在制作管理中">
						<img src="/images/icon_del.gif" style="cursor:pointer;" onClick="doClear('wc_id_${i.index}','wc_name_${i.index}',${i.index});">
						安装<input type="checkbox" class="TextBox" ${editDisabledStr} id="is_${i.index}" name="is_${i.index}" value="1" <c:if test="${item.businessBillItem.isSetu=='Y'}">checked</c:if> onChange="changeIs(${i.index});">
					</td>
					<td >
						<a href="javascript:doItemDelete(${i.index});">删除</a>
						<input type="hidden" id="status_${i.index}" name="status_${i.index}" value="${item.status}">
						<input type="hidden" id="price_type_${i.index}" name="price_type_${i.index}" value="${item.businessBillItem.priceType}">
						<input type="hidden" id="id_${i.index}" name="id_${i.index}" value="${item.oldId}">
						<input type="hidden" id="wc_id_${i.index}" name="wc_id_${i.index}" value="${item.businessBillItem.wcId}">
						<input type="hidden" id="unit_price_${i.index}" name="unit_price_${i.index}" value="${item.unitPriceStr}">
						<input type="hidden" id="cost_${i.index}" name="cost_${i.index}" value="${item.businessBillItem.cost}">
						<input type="hidden" id="is_coop_${i.index}" name="is_coop_${i.index}" value="${item.businessBillItem.isCoop}">
						<input type="hidden" id="is_setu_${i.index}" name="is_setu_${i.index}" value="${item.businessBillItem.isSetu}">
					</td>
				</tr>
				</c:if>
				</c:forEach>
				</tbody>
			 </table>
			 <div class="table-bot">
				 <span id="amountTotalSpan" style="float:right;PADDING-RIGHT:10px;color:#aaa">
				 	记录：${command.amouItemNum}条&nbsp;
					数量：<commonTag:parseBigDecimal source="${command.businessBill.amount}" />&nbsp;
				 </span>
			</div>
			<br>
			</c:if>
			<spring:bind path="command.items">
		    	<script language="javascript">
		        	setFormErrorMsg('<c:out value="${status.errorMessage}" />',7);
		    	</script>
			</spring:bind>

			<!-- 业务单 附加信息 -->
	        <div class="TopBottom_Border">
	        	<table class="BillElseInfo" cellspacing="0" cellpadding="0">
	        		<tr>
	            		<th width="84px">业务来源：</th>
	            		<td width="200px">
	            			<spring:bind path="command.businessBill.introducerName">
	                		<input type="text" class="tbInfo1 TextBox readonly" readOnly="readOnly" id="${status.expression}" name="${status.expression}" value="${status.value}" title="选择是由哪一个员工介绍过来的业务，用于给员工计算营销产值" />
	                		<img src="/images/make-a.gif" class="imgIconButton" onClick="selectStaffer('businessBill.introducerId','businessBill.introducerName');" title="选择是由哪一个员工介绍过来的业务，用于给员工计算营销产值" />
	                		<img src="/images/icon_del.gif" class="imgIconButton" onClick="doClear('businessBill.introducerId','businessBill.introducerName');" />
	            			<script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',8);
							</script>
	            			</spring:bind>
	            			<spring:bind path="command.businessBill.introducerId">
	                		<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
	            			</spring:bind>
	            		</td>
	            		<th width="84px">安装要求：</th>
	            		<td width="273px">
	            			<spring:bind path="command.businessBill.setupRequire">
	                		<input type="text" class="tbInfo2 TextBox" maxlength="50" onKeyUp="goNextInput('businessBill.ladingRequire');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
	                		<script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',9,'businessBill.setupRequire');
							</script>
	            			</spring:bind>
	            		</td>
	            		<th>付款方式：</th>
        				<spring:bind path="command.businessBill.payModeId">
        				<td>
        					<select id="${status.expression}" name="${status.expression}" class="ddlInfo3">
                				<c:if test="${id!=null && id!=''}"><option value="0">==请选择==</option></c:if>
                				<c:forEach var="item" items="${payModeList}">
                					<c:if test="${item.enabled=='Y' || item.id==status.value}"><option value="${item.id}" <c:if test="${status.value==item.id}">selected</c:if>>${item.modeName}</option></c:if>
                				</c:forEach>
            				</select>
            				<script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',10);
						    </script>
        				</td>
        				</spring:bind>
	        		</tr>
	        		<tr>
	            		<th>部门：</th>
			            <c:set var="depEditDisabledStr" value="" />
			            <c:if test="${fn:indexOf(currentUser.privs,';NO_BILL_DEPA;')!=-1}">
			                <c:set var="depEditDisabledStr" value="disabled='disabled'" />
			            </c:if>
            			<spring:bind path="command.businessBill.departmentId">
            			<td>
            				<select id="${status.expression}" name="${status.expression}" class="ddlInfo1" ${depEditDisabledStr} <c:if test="${depEditDisabledStr!=''}">style='background:#f6f6f6;'</c:if>>
                    			<option value="0">==请选择==</option>
                    			<commonTag:createSelectTree list="${departmentList}" emptyOption="0" defaultValue="${status.value}" />
                			</select>
                			<script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',10);
						    </script>
            			</td>
            			</spring:bind>
            			<th>提货要求：</th>
            			<spring:bind path="command.businessBill.ladingRequire">
                		<td>
                			<input type="text" class="tbInfo2 TextBox" maxlength="50" onKeyUp="goNextInput('businessBill.address');" id="${status.expression}" name="${status.expression}" value="${status.value}">
                			<script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',11,'businessBill.ladingRequire');
					        </script>
                		</td>
            			</spring:bind>
            			<th>收款账户：</th>
        				<spring:bind path="command.businessBill.bankAccountId">
        				<td>
        					<select id="${status.expression}" name="${status.expression}" class="ddlInfo3_long">
                				<c:if test="${id!=null && id!=''}"><option value="0">==请选择==</option></c:if>
                				<c:forEach var="item" items="${bankAccountList}">
                					<option value="${item.id}" <c:if test="${status.value==item.id}">selected</c:if>>${item.bankName}<c:if test="${item.accountName!=null && item.accountName!=''}">(${item.accountName})</c:if></option>
                				</c:forEach>
            				</select>
            				<script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',12);
						    </script>
        				</td>
        				</spring:bind>
        			</tr>
        			<tr>
            			<th>业务员：</th>
            			<td>
            				<spring:bind path="command.businessBill.managerName">
                			<input type="text" class="tbInfo1 TextBox readonly" readOnly="true" id="${status.expression}" name="${status.expression}" value="${status.value}" title="选择接单员，用于计算该员工的接单产值" />
                			<img src="/images/make-a.gif" class="imgIconButton" onClick="selectStaffer('businessBill.managerId','businessBill.managerName');" title="选择接单员，用于计算该员工的接单产值" />
                			<img src="/images/icon_del.gif" class="imgIconButton" onClick="doClear('businessBill.managerId','businessBill.managerName');" >
            				<script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',13);
							</script>
            				</spring:bind>
            				<spring:bind path="command.businessBill.managerId">
                			<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
            				</spring:bind>
            			</td>
            			<th><span class="MustInput">*</span>交货日期：</th>
        				<spring:bind path="command.deliverDateStr">
    					<td>
    						<input type="text" class="tbBillDate TextBox" maxlength="15" onKeyUp="goNextInput('businessBill.address');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
    						<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('deliverDateStr'),'yyyy-mm-dd',this);">
							<select id="deliverDateHourSelect" class="ddlDateHour" onChange="changeTimeSelect(this,'deliverDateHour');">
                				<c:forEach var="item" begin="0" step="1" end="23" varStatus="i"><c:if test="${i.index<10}"><c:set var="item" value="0${item}" /></c:if><option value="${item}" <c:if test="${item==command.deliverDateHour}">selected</c:if>>${item}</option></c:forEach>
							</select>
							<select id="deliverDateMinuteSelect" class="ddlDateMinute" onChange="changeTimeSelect(this,'deliverDateMinute');">
                				<c:forEach var="item" begin="0" step="1" end="59" varStatus="i"><c:if test="${i.index<10}"><c:set var="item" value="0${item}" /></c:if><option value="${item}" <c:if test="${item==command.deliverDateMinute}">selected</c:if>>${item}</option></c:forEach>
							</select>
							<script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',14,'deliverDateStr');
						    </script>
    					</td>
    					</spring:bind>
        				<th><span class="MustInput">*</span>结账日期：</th>
        				<spring:bind path="command.checkDateStr">
        				<td>
            				<input type="text" class="tbInfo3 TextBox" maxlength="15" onKeyUp="goNextInput('businessBill.address');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
            				<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('checkDateStr'),'yyyy-mm-dd',document.getElementById('checkDateStr'));">
            				<script language="javascript">
					       		setFormErrorMsg('<c:out value="${status.errorMessage}" />',15,'checkDateStr');
					        </script>
        				</td>
        				</spring:bind>
    				</tr>
    				<tr>
        				<th>跟单员：</th>
        				<td>
        					<spring:bind path="command.businessBill.followerNameStr">
            				<input type="text" class="tbInfo1 TextBox readonly" readOnly="true" id="${status.expression}" name="${status.expression}" value="${status.value}" onmouseover="this.title=this.value" />
            				<img src="/images/make-a.gif" class="imgIconButton" onClick="selectStafferRate('FOLLOWER','businessBill.followerIdStr','businessBill.followerNameStr');" title="选择跟单员，用于计算该员工的跟单产值" />
            				<img src="/images/icon_del.gif" class="imgIconButton" onClick="clearStafferRate('businessBill.followerIdStr','businessBill.followerNameStr');">
        					<script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',16);
							</script>
        					</spring:bind>
        					<spring:bind path="command.businessBill.followerIdStr">
            					<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
        					</spring:bind>
        				</td>
        				<th>送货地址：</th>
        				<spring:bind path="command.businessBill.address">
        				<td>
        					<input type="text" class="tbInfo2 TextBox" maxlength="50" onKeyUp="goNextInput('businessBill.content');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
        					<script language="javascript">
				          		setFormErrorMsg('<c:out value="${status.errorMessage}" />',17,'businessBill.address');
				          	</script>
        				</td>
        				</spring:bind>
        				<th>&nbsp;</th>
        				<td>&nbsp;</td>
    				</tr>
    				<tr>
        				<td colspan="4"><div class="Divider"></div></td>
        				<th>&nbsp;</th>
        				<td>&nbsp;</td>
    				</tr>
    				<tr>
        				<th>设计类型：</th>
        				<spring:bind path="command.businessBill.designType">
        				<td>
        					<select class="ddlInfo1" id="${status.expression}" name="${status.expression}">
                				<option value="SELF">公司设计</option>
                				<option value="CLIENT" <c:if test="${status.value=='CLIENT'}">selected</c:if>>客户来稿</option>
            				</select>
        				</td>
        				</spring:bind>
        				<th>摘要：</th>
        				<spring:bind path="command.businessBill.content">
        				<td>
        					<input type="text" class="tbInfo2 TextBox" maxlength="200" onKeyUp="goNextInput('businessBill.mark');" id="${status.expression}" name="${status.expression}" value="${status.value}" />
        					<script language="javascript">
				          		setFormErrorMsg('<c:out value="${status.errorMessage}" />',20,'businessBill.content');
				          	</script>
        				</td>
        				</spring:bind>
        				<th>&nbsp;</th>
        				<td>&nbsp;</td>
    				</tr>
    				<tr>
        				<th>设计员：</th>
        				<td>
        					<spring:bind path="command.businessBill.designerNameStr">
            				<input type="text" class="tbInfo1 TextBox readonly" readOnly="true" id="${status.expression}" name="${status.expression}" value="${status.value}" />
            				<img src="/images/make-a.gif" class="imgIconButton" onClick="selectStafferRate('DESIGNER','businessBill.designerIdStr','businessBill.designerNameStr');" title="允许选择多个设计员，同时设置各个设计员在本单设计的比例，独立完成为1" />
            				<img src="/images/icon_del.gif" class="imgIconButton" onClick="clearStafferRate('businessBill.designerIdStr','businessBill.designerNameStr');">
        					<script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',22);
					        </script>
        					</spring:bind>
        					<spring:bind path="command.businessBill.designerIdStr">
            				<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
        					</spring:bind>
        				</td>
        				<th>备注：</th>
        				<spring:bind path="command.businessBill.mark">
        				<td>
        					<input type="text" class="tbInfo2 TextBox" maxlength="200" id="${status.expression}" name="${status.expression}" value="${status.value}" />
        					<script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',23,'businessBill.mark');
					        </script>
        				</td>
        				</spring:bind>
        				<th>&nbsp;</th>
        				<td>&nbsp;</td>
    				</tr>
    			</table>
    		</div>

			<!-- 业务单 附件 -->
    		<br>
    		<table class="BillAttachments" cellspacing="0" cellpadding="0">
    			<tr>
            		<td>
                		<iframe name="accessoryFrm" id="accessoryFrm" scrolling="no" border="0" frameborder="0" height="0" width="100%" src="/business/AccessoryList.ihtm?agent_type=BUSINESS_BILL&code=${command.tmpCode}&edit_flag=1"></iframe>
            		</td>
    			</tr>
    		</table>

			<div class="BillNotes">
                <span>开单人：${command.businessBill.createrName} <c:if test="${command.businessBill.createTime!=null}"><fmt:formatDate value="${command.businessBill.createTime}" pattern="yyyy-MM-dd HH:mm"/></c:if></span>
                <span>审核人：<c:if test="${command.businessBillExt.examinerId!=0}">${command.businessBillExt.examinerName} <c:if test="${command.businessBillExt.examineTime!=null}"><fmt:formatDate value="${command.businessBillExt.examineTime}" pattern="yyyy-MM-dd HH:mm"/></c:if></c:if></span>
                <span>结清：${command.businessBillExt.closerName} <fmt:formatDate value="${command.businessBillExt.closeTime}" pattern="yyyy-MM-dd HH:mm"/></span>
                <span>最后打印：<c:if test="${command.businessBillExt.lastPrinter!=null && command.businessBillExt.lastPrinter!=''}">${command.businessBillExt.lastPrinter} / 已打印${command.businessBillExt.printNum}次</c:if></span>
                <span>修改人：<c:if test="${command.businessBill.modifierId!=0}">${command.businessBill.modifierName} <fmt:formatDate value="${command.businessBill.modifyTime}" pattern="yyyy-MM-dd HH:mm"/></c:if></span>
                <span>单据帐套：${command.tallySetName}</span>
                <spring:bind path="command.businessBill.tallySetId">
			    	<script language="javascript">
			          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',1);
			    	</script>
				</spring:bind>
			</div>
			
		</div>
		
		<!-- 业务单 底栏按钮 -->
		<div class="Footer">
			<div id="buttonDiv">
				<input type="button" class="buttom-a" value=" 保 存 " onClick="doSave('');">
				<input type="button" class="buttom-a" value=" 保存并打印 " onClick="doSave('PRINT');">
				<input type="button" class="buttom-a" value=" 取 消 " onClick="doCancel();">
				<input type="hidden" name="continue_flag" id="continue_flag" value="">
				<spring:bind path="command.sychronizeValue"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.tmpCode"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.orderDateHour"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.orderDateMinute"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.deliverDateHour"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.deliverDateMinute"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.canSelectContact"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.imprestStr"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.favCostStr"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
				<spring:bind path="command.businessBill.cost"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
			</div>
			<div id="waitDiv" style="display:none">
    			<span>请稍候...</span>
			</div>
		</div>
		
	</div>
	</form>
</div>
</body>
</html>
